package org.bonorsoft.modules.dingding.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.bonorsoft.common.system.vo.Ztree;
import org.bonorsoft.modules.dingding.entity.Params;
import org.bonorsoft.modules.dingding.entity.SysDingUser;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Description: 钉钉用户
 * @Author: WilliamYe
 * @Date:   2020-11-13
 * @Version: V1.0
 */
public interface ISysDingUserService extends IService<SysDingUser> {

    void addOrUpdateUser(List<String> userList, String userid);

    void deleteUser(List<String> userList);

    void updateUser(List<String> userId);

    SysDingUser getUserByMobile(String mobile);

    SysDingUser getUserActiveByMobile(String mobile);

    IPage<SysDingUser> selectUser(Page<SysDingUser> page, SysDingUser sysUser, Params params, HttpServletRequest request);

    /**
     * 钉钉同步用户部门信息
     * @param deptIdList
     */
    void synchronousUser(String deptIdList);

    /**
     * 根据角色id查询用户
     * @param page
     * @param sysDingUser
     * @param req
     * @return
     */
    IPage<SysDingUser> pageByConditions(Page<SysDingUser> page, SysDingUser sysDingUser, HttpServletRequest req);

    /**
     * 根据菜单id获取全部用户userid
     * @param menuId
     * @return
     */
    List<String> getAllMenuUser(Long menuId);

    /**
     * 根据角色id获取全部用户userid
     * @param roleId
     * @return
     */
    List<String> getAllRoleUser(Integer roleId);

    /**
     * 根据用户id设置部门ID
     * @param userId
     * @param deptId
     */
    public void updateUserDepart(String userId, Long deptId);

    public List<Ztree> selectDeptUserTree();
}
